# Contributor: Danilo Falcão <danilo@falcao.org>
# Maintainer: Danilo Falcão <danilo@falcao.org>
pkgname=py3-pelican
_pkgname=pelican
pkgver=4.8.0
pkgrel=0
pkgdesc="Static site generator written in Python"
options="!check" # Tests require locale support
url="https://getpelican.com"
arch="noarch"
license="AGPL-3.0-only"
depends="
	python3
	py3-feedgenerator
	py3-jinja2
	py3-pygments
	py3-docutils
	py3-tz
	py3-blinker
	py3-unidecode
	py3-dateutil
	py3-markdown
	py3-rich
	"
makedepends="py3-setuptools"
checkdepends="py3-django"
source="https://files.pythonhosted.org/packages/source/p/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$_pkgname-$pkgver

prepare() {
	default_prepare

	# remove shebang from python files
	sed -i '1d' \
		pelican/tools/*.py \
		pelican/tools/templates/*.py.jinja2
}

replaces="pelican" # Backwards compatibility
provides="pelican=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	python3 setup.py build
}

check() {
	python3 setup.py test
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="
696b7212bcb9cf89db7db028bb20e314bb40eff3f7881ffaa786b8995965c6247a58676e795fd6571b6eabecc483caf9ddaf134bca027a521b036e3448eba8bf  pelican-4.8.0.tar.gz
"
